# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Monitoring.V3.Model.CreateCollectdTimeSeriesResponse do
  @moduledoc """
  The CreateCollectdTimeSeries response.

  ## Attributes

  *   `payloadErrors` (*type:* `list(GoogleApi.Monitoring.V3.Model.CollectdPayloadError.t)`, *default:* `nil`) - Records the error status for points that were not written due to an error in the request.Failed requests for which nothing is written will return an error response instead. Requests where data points were rejected by the backend will set summary instead.
  *   `summary` (*type:* `GoogleApi.Monitoring.V3.Model.CreateTimeSeriesSummary.t`, *default:* `nil`) - Aggregate statistics from writing the payloads. This field is omitted if all points were successfully written, so that the response is empty. This is for backwards compatibility with clients that log errors on any non-empty response.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :payloadErrors => list(GoogleApi.Monitoring.V3.Model.CollectdPayloadError.t()) | nil,
          :summary => GoogleApi.Monitoring.V3.Model.CreateTimeSeriesSummary.t() | nil
        }

  field(:payloadErrors, as: GoogleApi.Monitoring.V3.Model.CollectdPayloadError, type: :list)
  field(:summary, as: GoogleApi.Monitoring.V3.Model.CreateTimeSeriesSummary)
end

defimpl Poison.Decoder, for: GoogleApi.Monitoring.V3.Model.CreateCollectdTimeSeriesResponse do
  def decode(value, options) do
    GoogleApi.Monitoring.V3.Model.CreateCollectdTimeSeriesResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Monitoring.V3.Model.CreateCollectdTimeSeriesResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
